package com.briup.estore.Service;

import com.briup.estore.bean.Book;
import com.briup.estore.mapper.CollectMapper;
import com.briup.estore.utils.BeanCopyUtils;
import com.briup.estore.vo.CollectVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service

public class CollectService {
    @Autowired
    private CollectMapper collectMapper;

    public List<CollectVO> getCollects(Integer userId) {
        List<Book> books =collectMapper.getCollect(userId);
        List<CollectVO> collectVOS = BeanCopyUtils.copyBeanList(books,CollectVO.class);
        System.out.println("collectVOS = " + collectVOS);
        return collectVOS;
    }
}
